﻿<phone:PhoneApplicationPage
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:controls="clr-namespace:ToyundaPhone.Controls" 
	xmlns:helpers="clr-namespace:ToyundaPhone.Helpers"
	xmlns:SampleData1="clr-namespace:Expression.Blend.SampleData.SongsDataSource"
	xmlns:SampleData2="clr-namespace:Expression.Blend.SampleData.PlaylistsDataSource" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	x:Name="phoneApplicationPage" 
	x:Class="ToyundaPhone.Pages.SongListPage"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
	SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
	shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded" OrientationChanged="PhoneApplicationPage_OrientationChanged">
	<phone:PhoneApplicationPage.Resources>
		<SampleData1:SongsDataSource x:Key="SongsDataSource" d:IsDataSource="True"/>
		<SampleData2:PlaylistsDataSource x:Key="PlaylistsDataSource" d:IsDataSource="True"/>
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBar.MenuItems>
				<shell:ApplicationBarMenuItem IsEnabled="True" Text="Choisir liste d'ajout" Click="ChooseList_Click"/>
				<shell:ApplicationBarMenuItem IsEnabled="True" Text="À propos" Click="About_Click" />
			</shell:ApplicationBar.MenuItems>
			<shell:ApplicationBarIconButton IconUri="/icons/appbar.lists.rest.png" IsEnabled="True" Text="Listes" Click="Playlists_Click"/>
			<shell:ApplicationBarIconButton IconUri="/icons/appbar.favs.rest.png" IsEnabled="True" Text="Favoris" Click="Favorites_Click"/>
			<shell:ApplicationBarIconButton IconUri="/icons/appbar.refresh.rest.png" IsEnabled="True" Text="Mettre à jour" Click="Update_Click"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

	<Grid x:Name="LayoutRoot" Background="Transparent">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<controls:SongSearchControl x:Name="Search" ApplicationName="{StaticResource ApplicationNameUC}" Hint="rechercher dans la liste" TextChanged="Search_TextChanged" Foreground="{x:Null}" />
		<controls:SongListControl x:Name="songList" Grid.Row="1" Margin="12,0,12,0" d:DataContext="{Binding Source={StaticResource SongsDataSource}}" DataContext="{Binding ElementName=phoneApplicationPage}" Search="{Binding Text, ElementName=Search}" EmptyForeground="{StaticResource PhoneForegroundBrush}" EmptyText="Rien à afficher." SelectPlaylist="SongList_SelectPlaylist" RefreshAlertText="La liste des titres est vide. Pour obtenir la liste et utiliser l'application, le téléchargement de la liste depuis le serveur est nécessaire. Veuillez appuyer sur le bouton « Mettre à jour » dans la barre d'application afin d'initier le téléchargement. L'opération nécessite l'utilisation de votre connexion de données et un accès Internet fonctionnel."/>
		<toolkit:ListPicker x:Name="listPicker" Visibility="Collapsed" d:DataContext="{Binding Source={StaticResource PlaylistsDataSource}}" DataContext="{Binding ElementName=phoneApplicationPage}" ItemsSource="{Binding Playlists}" ItemTemplate="{StaticResource PlaylistPickerDataTemplate}" Header="Sélectionnez une liste" ExpansionMode="FullScreenOnly" SelectionChanged="ListPicker_SelectionChanged" FullModeItemTemplate="{StaticResource PlaylistPickerDataTemplate}" />
	</Grid>
</phone:PhoneApplicationPage>